Repository navigation
🐛 fix(sqlite): finalize uncached statements promptly - #1348
Open
gaborbernat wants to merge 1 commit into
Open
gaborbernat wants to merge 1 commit into
gaborbernat wants to merge 1 commit into
Conversation
Routing uncached statements through the managed LRU wrapper leaves finalization to garbage collection. Prepare them natively when caching is disabled so closing the cursor releases the SQLite statement. Refs oracle#1347 Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With statement caching disabled, closing a cursor and its connection can leave the database descriptor open until garbage collection. Filelock relies on explicit closure to reuse its SQLite connections safely. Issue #1347
Connections with caching disabled now prepare statements in the native extension. This keeps their lifetime tied to the cursor. Connections with a positive cache size continue to use the LRU wrapper.
I built the patched SQLite extension against GraalPy 25.6.5 on Linux. The descriptor regression fails with the released extension and passes with the patched build. All seven Filelock assertions that failed with the released extension also passed.
Fixes #1347